package com.mimaxueyuan.disruptor.demo1;

import com.lmax.disruptor.EventHandler;

/**
 * Once we have the event defined we need to create a consumer that will handle these events.
 * In our case all we want to do is print the value out the the console.
 *
 * @author: Kevin
 * @官网: 	www.mimaxueyuan.com
 * @Q Q群:	660567408
 * @Email:	mimaxueyuan@163.com
 * [每天进步一点点、人生带来大改变...]
 * [本代码对应视频地址:http://study.163.com/course/introduction/1004573050.htm]
 */
public class LongEventHandler implements EventHandler<LongEvent> {

	/**
	 * event:发布到RingBuffer中的事件
	 * sequence:当前正在处理的事件序列号
	 * endOfBatch:是否为Ringbuffer的最后一个
	 */
	@Override
	public void onEvent(LongEvent event, long sequence, boolean endOfBatch) throws Exception {
		System.out.println("["+Thread.currentThread().getName()+"]LongEventHandler consum -> " + event);
	}

}
